package com.ddm.withoutpaper;


import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;

import com.ddm.withoutpaper.controller.UIController;

public class SplashActivity extends Activity {
	
	private int timer = 0;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
		
		Thread thread = new Thread() {
			
			@Override
			public void run() {
				while(timer < 3000) {
					try {
						sleep(500);
						timer += 500;
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
				timer = 0;
				UIController.getInstance().setScreen(SplashActivity.this, LoginActivity.class);
			}
		};
		thread.start();
		
	}


	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.splash, menu);
		return true;
	}

}
